package com.company.单例模式.饿汉模式;

public class Instance {
    private static Instance instance = new Instance();

    private Instance() {
        System.out.println("饿汉模式创建了");
    }

    //通过公共的方法去得到私有构造
    public static Instance getInstance(){
        return instance;
    }
}
